Grid9

A = (4.126496046345031, 3.1536959693893905)
B = (4.5154274211422365, 3.329342396717161)
d_{AB} = Distance(A, B)
θ: atan(Slope[Line[A, B]])
m = 4 (slider from 0 to 10, step 1)
n = 3 (slider from 0 to 10, step 1)
a = Segment(A, B)
e_m = 5 (slider from 1 to 10, step 1)
e_n = 2 (slider from 1 to 10, step 1)
GridAllParallelABsegments = Sequence(Segment[(x(A) - n * d_{AB} * cos(θ) - i * d_{AB} * sin(θ), y(A) - n * d_{AB} * sin(θ) + i * d_{AB} * cos(θ)), (x(A) + n * d_{AB} * cos(θ) - i * d_{AB} * sin(θ), y(A) + n * d_{AB} * sin(θ) + i * d_{AB} * cos(θ))], i, -m, m, 1 / e_m)
GridAllPerpABsegments = Sequence(Segment[(x(A) + j * d_{AB} * cos(θ) - m * d_{AB} * sin(θ), y(A) + j * d_{AB} * sin(θ) + m * d_{AB} * cos(θ)), (x(A) + j * d_{AB} * cos(θ) + m * d_{AB} * sin(θ), y(A) + j * d_{AB} * sin(θ) - m * d_{AB} * cos(θ))], j, -n, n, 1 / e_n)